package com.aqie.easy.bitOperation;

/**
 * 231 2的幂  todo
 */
public class IsPowerOfTwo {
    /**
     * 6ms
     * @param n
     * @return
     */
    public boolean isPowerOfTwo(int n) {
        return n > 0 && (n & (n - 1)) == 0;
    }
}
